﻿#region Using directives
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using gpsMe.Properties;
using gpsMe.Classes;
#endregion

namespace gpsMe.UI.Forms
{
    /// <summary>
    /// Form that displays all extra tools available
    /// </summary>
    public partial class gpsMeExtraToolsForm : Form
    {
        #region Instance
        /// <summary>
        /// Current gpsMeExtraToolsForm instance
        /// </summary>
        public static gpsMeExtraToolsForm Instance { get; private set; }
        #endregion

        #region Constructor
        /// <summary>
        /// Default constructor
        /// </summary>
        public gpsMeExtraToolsForm()
        {
            Instance = this;
            this.InitializeComponent();
            this.Text = gpsMeProperties.GPSME_TITLE;
            this.closeButton.Text = gpsMeLanguage.Instance.CloseLabel;
        }
        #endregion

        #region Methods / Functions / Events
        /// <summary>
        /// Invoked when the close button is clicked
        /// </summary>
        /// <param name="p_oSender"></param>
        /// <param name="p_oEventArgs"></param>
        private void closeButton_Click(object p_oSender, EventArgs p_oEventArgs)
        {
            this.Close();
        }

        /// <summary>
        /// Invoked when the GPS logger button is clicked
        /// </summary>
        /// <param name="p_oSender"></param>
        /// <param name="p_oEventArgs"></param>
        private void gpsLoggerButton_Click(object p_oSender, EventArgs p_oEventArgs)
        {
            if ((gpsMeExtraGpsLoggerForm.Instance == null) || gpsMeExtraGpsLoggerForm.Instance.IsDisposed)
                new gpsMeExtraGpsLoggerForm();
            gpsMeExtraGpsLoggerForm.Instance.ShowDialog();
            gpsMeExtraGpsLoggerForm.Instance.Dispose();
        }
        #endregion
    }
}